package com.lyb.server.hb.demo.bean;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 回调通知实体类
 * 此实体类所以参数必须为String型
 */
@Data
public class PayResult implements Serializable {
    private static final long serialVersionUID = 42L;

    //订单编号
    @ApiModelProperty(value = "聚合平台订单编号",name = "orderNo")
    private String orderNo;

    //对接方订单号（api支付）
    @ApiModelProperty(value = "对接方订单号（api支付）",name = "outTradeNo")
    private String outTradeNo;

    //订单类型:0交易单 1退款单
    @ApiModelProperty(value = "订单类型:0交易单 1退款单",name = "tradeType")
    private Integer tradeType;

    //订单状态：交易单：1未支付2支付成功3支付失败4支付超时   退款单：1处理中2退款成功3退款失败
    @ApiModelProperty(value = "订单状态：交易单：1未支付2支付成功3支付失败4支付超时   退款单：1处理中2退款成功3退款失败",name = "tradeState")
    private Integer tradeState;

    @ApiModelProperty(value = "上游通道方返回的微信/支付宝/银联订单号",name = "transactionId")
    private String transactionId;

    @ApiModelProperty(value = "订单金额，退款单时为负数",name = "price")
    private BigDecimal price;

    @ApiModelProperty(value = "用户支付金额(元)（指使用优惠券的情况下，这里等于总金额-优惠券金额）",name = "totalAmount")
    private BigDecimal totalAmount;

    @ApiModelProperty(value = "是否清算：0.否 1.是",name = "isLiquidation")
    private Integer isLiquidation;

    @ApiModelProperty(value = "清算状态 1未付款2付款成功3付款失败",name = "liquidationState")
    private Integer liquidationState;

    @ApiModelProperty(value = "用户结算卡实际到账金额")
    private BigDecimal actualAmount;

    @ApiModelProperty(value = "支付方式：1微信 2支付宝 3银联 4数币 9现金 11手机pos",name = "payWay")
    private Integer payWay;

    @ApiModelProperty(value = "订单备注",name = "remarks")
    private String remarks;

    @ApiModelProperty(value = "退款原因",name = "reason")
    private String reason;

    @ApiModelProperty(value = "交易失败原因,清算失败原因",name = "message")
    private String message;

    @ApiModelProperty(value = "微信openId/支付宝userId",name = "openId")
    private String openId;

    @ApiModelProperty(value = "附加字段，作为自定义参数原样返回(api支付)",name = "attach")
    private String attach;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")//返给前端数据时, 日期自动格式化,需要加上时区
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")//前端传递时间参数到后台时,String固定格式参数会自动封装成时间类型，不需要时区
    @ApiModelProperty(value = "支付成功时间/退款到账时间",name = "payTime")
    private Date payTime;

    @ApiModelProperty(value = "清算(结算)时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")//返给前端数据时, 日期自动格式化,需要加上时区
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")//前端传递时间参数到后台时,String固定格式参数会自动封装成时间类型，不需要时区
    private Date liquidationData;


}
